/*
* flow.js
* 通用流程模块
* date: 2021-01-15
* version: 1.0.0-SNAPSHOT
*/
import {post} from "@/config/axios.js";

// 流程配置接口
export const flowConfig = {
    // 创建流程配置
    create: (param= {}, config= {}) => post('/flow/flowConfig/create', param, config),
    // 删除流程配置
    delete: (param= {}, config= {}) => post('/flow/flowConfig/delete', param, config),
    // 禁用流程配置
    disable: (param= {}, config= {}) => post('/flow/flowConfig/disable', param, config),
    // 启用流程配置
    enable: (param= {}, config= {}) => post('/flow/flowConfig/enable', param, config),
    // 获取流程配置详情
    get: (param= {}, config= {}) => post('/flow/flowConfig/get', param, config),
    // 分页查询流程配置
    listPaged: (param= {}, config= {}) => post('/flow/flowConfig/listPaged', param, config),
    // 格式化流程图
    // 1. 校验， 2. 计算节点坐标, 3. 美化
    resort: (param= {}, config= {}) => post('/flow/flowConfig/resort', param, config),
    // 设置为默认流程配置
    settingDefault: (param= {}, config= {}) => post('/flow/flowConfig/settingDefault', param, config),
    // 更新流程配置
    update: (param= {}, config= {}) => post('/flow/flowConfig/update', param, config),
};
// 审批事项
export const task = {
    // 抄送事项
    CCPaged: (param= {}, config= {}) => post('/flow/task/CCPaged', param, config),
    // 审核事项
    approvalPaged: (param= {}, config= {}) => post('/flow/task/approvalPaged', param, config),
    // 统计待办事项数量
    countTask: (param= {}, config= {}) => post('/flow/task/countTask', param, config),
    // 交接待办事项
    handoverTask: (param= {}, config= {}) => post('/flow/task/handoverTask', param, config),
    // 我的事项
    needDealPaged: (param= {}, config= {}) => post('/flow/task/needDealPaged', param, config),
    // 通知设置已读
    noticeRead: (param= {}, config= {}) => post('/flow/task/noticeRead', param, config),
    // 发起事项
    startPaged: (param= {}, config= {}) => post('/flow/task/startPaged', param, config),
    // 我的事项
    taskPaged: (param= {}, config= {}) => post('/flow/task/taskPaged', param, config),
};
// 节点接口
export const node = {
    // 获取流程当前待审批的节点
    needToApprovalNode: (param= {}, config= {}) => post('/flow/node/needToApprovalNode', param, config),
    // 获取节点下的条件节点树
    queryConditionTree: (param= {}, config= {}) => post('/flow/node/queryConditionTree', param, config),
};
// 回调钩子
export const flowHook = {
    // 融合职位
    // 把多个职位融合成一个职位
    dutyMerge: (param= {}, config= {}) => post('/flow/flowHook/duty/merge', param, config),
};
// 系统业务接口
export const sysBusiness = {
    // 创建系统业务
    create: (param= {}, config= {}) => post('/flow/sysBusiness/create', param, config),
    // 删除系统业务
    delete: (param= {}, config= {}) => post('/flow/sysBusiness/delete', param, config),
    // 禁用系统业务
    disable: (param= {}, config= {}) => post('/flow/sysBusiness/disable', param, config),
    // 启用系统业务
    enable: (param= {}, config= {}) => post('/flow/sysBusiness/enable', param, config),
    // 分页查询系统业务
    listPaged: (param= {}, config= {}) => post('/flow/sysBusiness/listPaged', param, config),
    // 锁定系统业务
    lock: (param= {}, config= {}) => post('/flow/sysBusiness/lock', param, config),
    // 解锁系统业务
    unlock: (param= {}, config= {}) => post('/flow/sysBusiness/unlock', param, config),
    // 更新系统业务
    update: (param= {}, config= {}) => post('/flow/sysBusiness/update', param, config),
};
// 流程审批记录接口
export const approval = {
    // 设置节点审批人
    configureApproval: (param= {}, config= {}) => post('/flow/approval/configureApproval', param, config),
    // 提交审批
    create: (param= {}, config= {}) => post('/flow/approval/create', param, config),
    // 查询审批记录列表
    list: (param= {}, config= {}) => post('/flow/approval/list', param, config),
};
// 业务信息接口
export const business = {
    // 分页查询业务信息
    listPaged: (param= {}, config= {}) => post('/flow/business/listPaged', param, config),
    // 查询业务概要树（包含业务类型）
    listTreeBrief: (param= {}, config= {}) => post('/flow/business/listTreeBrief', param, config),
};
// 流程接口
export const flow = {
    // 加签
    addSign: (param= {}, config= {}) => post('/flow/flow/addSign', param, config),
    // 发起流程接口
    create: (param= {}, config= {}) => post('/flow/flow/create', param, config),
    // 删除单位流程
    // 注意：仅在开发、测试环境开放，删除该单位下流程业务的一切数据
    deleteByCom: (param= {}, config= {}) => post('/flow/flow/deleteByCom', param, config),
    // 获取流程详情
    get: (param= {}, config= {}) => post('/flow/flow/get', param, config),
    // 初始化
    init: (param= {}, config= {}) => post('/flow/flow/init', param, config),
    // 发起人撤回流程
    recall: (param= {}, config= {}) => post('/flow/flow/recall', param, config),
};
// 业务类型信息接口
export const businessType = {
    // 创建业务类型信息
    create: (param= {}, config= {}) => post('/flow/businessType/create', param, config),
    // 删除业务类型信息
    delete: (param= {}, config= {}) => post('/flow/businessType/delete', param, config),
    // 禁用业务类型
    disable: (param= {}, config= {}) => post('/flow/businessType/disable', param, config),
    // 启用业务类型
    enable: (param= {}, config= {}) => post('/flow/businessType/enable', param, config),
    // 查询业务类型信息列表
    list: (param= {}, config= {}) => post('/flow/businessType/list', param, config),
    // 分页查询业务类型信息
    listPaged: (param= {}, config= {}) => post('/flow/businessType/listPaged', param, config),
    // 更新业务类型信息
    update: (param= {}, config= {}) => post('/flow/businessType/update', param, config),
};

export default {flowConfig, task, node, flowHook, sysBusiness, approval, business, flow, businessType, }